package cc.openhome;
public class RPG2 {
    public static void main(String[] args) {
        Swordman swordman= new Swordman();
        swordman.setName("qq");
        swordman.setLevel(100);
        swordman.setBlood(200);

        Magician magician= new Magician();
        magician.setName("张瑞琦");
        magician.setLevel(200);
        magician.setBlood(1000);

       showBlood(swordman);
       showBlood(magician);

    }

     static void showBlood(Role role) {
         System.out.printf("%s 血量 %d%n",role.getName(),role.getBlood());
    }


}
